﻿#region [MainPage Using Statements]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
#endregion

namespace ControlPanelOOB
{
    /// <summary>
    /// First UserControl loaded.
    /// It will decide wether the application is running in or out of the 
    /// browser (OOB) and will load the appropriate UserControl
    /// </summary>
    public partial class MainPage : UserControl
    {
        #region [MainPage Contructor]
        /// <summary>
        /// MainPage Constructor
        /// </summary>
        public MainPage()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }
        #endregion

        #region [MainPage EventHandlers]
        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            if (Application.Current.IsRunningOutOfBrowser)
            {
                LayoutRoot.Children.Add(new OutOfBrowser());
            }
            else
            {
                LayoutRoot.Children.Add(new InBrowser());
            }
        }
        #endregion
    }
}
